#ifndef SPARSE_H
#define SPARSE_H
#include "array.h"

typedef float real;

/* A class representing a sparse vector */
class vector{
    struct entry{
        int ind;
        real val;
    };
    entry* buf;
    int len;
    int label;
public:
    vector(int l, const Array<int>& ai, const Array<real>& av);

    vector();
    
    vector(const vector& v);

	vector& operator=(const vector& v);

    ~vector();

    void update(const vector* x);

    void at(int i, int& ind, real& val)const;

    real dot(const vector& v)const;

    const int getClass()const;
    const int size()const;
};
#endif 
